package com.example.demo.entity;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import java.time.LocalDateTime;

@JsonInclude(JsonInclude.Include.NON_NULL)
@Data
public class ChatMessage{
    private String senderUsername;

    private String receiveUsername;

    private String content;

    private LocalDateTime createAt;

    private Integer type;

    private String key;
    /**
     * 擦除类型和接受者名称*/
    public void filter(){
        this.setType(null);
        this.setReceiveUsername(null);
    }
}
